<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪类选择器</title>
</head>
<body>
    <table>
        <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
            <td>4</td>
        </tr>
        <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
            <td>4</td>
        </tr>
        <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
            <td>4</td>
        </tr>
        <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
            <td>4</td>
        </tr>
    </table>
</body>
<script src="./js/jquery.js"></script>
<script>
    $("table").css("width", "100%")
    $("table tr").css("width", "100%")
    $("tr:odd").css("background","cyan")
    $("tr:even").css("background","hotpink")
    $("tr").hover(function() {
        $(this).css({
            "opacity":"0.8",
            "color":"white",
            "background":"black"
        })
    },function() {
        $(this).css("opacity","1")
    })
</script>
</html>